<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Object.setPrototypeOf()</title>
  </head>
  <body>
    <p>Object.setPrototypeOf(obj,prototype) 设置对象原型</p>
    <p>如果obj不是对象，则会转换成对象。设置原型操作返回的还是原对象</p>

    <pre>
      Object.setPrototypeOf(1, {});
      Object.setPrototypeOf("foo", {});
      Object.setPrototypeOf(true, {});
    </pre>
  </body>
</html>

<script>
  Object.setPrototypeOf(1, {});
  Object.setPrototypeOf("foo", {});
  Object.setPrototypeOf(true, {});
</script>
